package org.kernely.test.stream;

import org.kernely.test.todopage.ToDoView;
import org.kernely.ui.mvp.IKernelyView;

import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TextField;

/**
 * View of the streams test.
 */
@SuppressWarnings("serial")
public class StreamsView extends GridLayout implements IKernelyView{

	/**
	 * The View ID
	 */
	public static final Class<? extends IKernelyView> ID_VIEW = StreamsView.class;

	private Button newStreamButton;
	private TextField contentField;
	
	/**
	 * Constructor of the view.
	 */
	public StreamsView(){
		Panel northPanel = new Panel();
		Panel southPanel = new Panel();
		Panel eastPanel = new Panel();
		newStreamButton = new Button("Post on stream");
		contentField = new TextField();
		contentField.setColumns(100);
		
		this.setColumns(4);
		this.setRows(2);
		this.addComponent(northPanel,0,0);
		this.addComponent(southPanel,0,1);
		this.addComponent(eastPanel,1,0,3,1);
		northPanel.addComponent(new Label("Test Bundle stream page"));
		southPanel.addComponent(new Label("Step 1 : Type a title in the field and then click on the 'Post on stream' button."));
		southPanel.addComponent(new Label("Step 2 : Go to the Applications / Test bundle / Streams to check the new message exists."));
		eastPanel.addComponent(contentField);
		eastPanel.addComponent(newStreamButton);
		this.setSizeFull();
	}
	
	
	
	/**
	 * Gets the newStreamButton
	 * @return the newStreamButton
	 */
	public Button getNewStreamButton() {
		return newStreamButton;
	}



	/**
	 * Gets the titleField
	 * @return the titleField
	 */
	public TextField getContentField() {
		return contentField;
	}



	/**
	 * Unused method
	 */
	public Component getComponent() {
		return this;
	}

}
